classdef E4438C < SignalGenerator
    
     properties(Access = protected)
        driver;
        
     end
    
     methods
         
         function this = E4438C(GPIB_controller, GPIB_address, address)
            this = this@SignalGenerator(GPIB_controller, GPIB_address, address);
            this.driver = icdevice('agilent_e4438c.mdd',this.conn);
            connect(this.driver);
            devicereset(this.driver);
            
        end
        
        function delete(this)
            this.outputState=0;       
            delete(this.driver);
            
        
        end
        
        function set.frequency(this,frequency)
            this.frequency = frequency;
            freq = get(this.driver,'Frequency');
            set(freq,'Frequency',this.frequency);
        end
        
        function setPower(this,power)
            this.power = power;
            pow = get(this.driver,'Power');
            set(pow,'Power',this.power);
        end
        
        function setOutputState(this, outputState)
            
            this.output_state = outputState;
            state = get(this.driver,'Output');
            set(state,'State',this.output_state);                      
        end
        
        
     end
end